<template>
	<div id="dange">

		<el-dialog title="保单信息" :visible.sync="dialogTableVisible5" @row-click="handleCurrentChange5">
			<el-table :data="plist">
				<el-table-column property="warrantyId" label=" 保单编号" type="" width="150"></el-table-column>
				<el-table-column property="recognizeeName" label="被保人" width="150"></el-table-column>
				<el-table-column property="plateNumber" label="车牌号" width="150"></el-table-column>
			</el-table>
			<el-button type="primary" @click="xuanz()">确定</el-button>
		</el-dialog>

		<el-dialog title="出险信息增改" :visible.sync="dialogFormVisible1">
			<el-form :model="form" ref="form">
				<!-- <el-col :span="12">
					<el-form-item label="车牌号:" :label-width="formLabelWidth">
						<el-select v-model="form.warrantyId" filterable placeholder="请选择车牌号">
							<el-option :key="i" v-for="(item,i) in plist" :label="item.plateNumber" :value="item.warrantyId"></el-option>

						</el-select>
					</el-form-item>
				</el-col> -->
				<el-col :span="24">
					<el-form-item label="保单号:" :label-width="formLabelWidth">
						<el-input v-model="form.warrantyId" autocomplete="off"></el-input>
						<el-button type="primary" @click="dialogTableVisible5=true">查找保单号</el-button>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="报案人:" :label-width="formLabelWidth">
						<el-input v-model="form.informants" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出险司机:" :label-width="formLabelWidth">
						<el-input v-model="form.driver" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="司机电话:" :label-width="formLabelWidth">
						<el-input v-model="form.driverMob" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="ys">
					<el-form-item label="出险时间:" :label-width="formLabelWidth">
						<el-date-picker type="date" placeholder="选择出厂日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="form.dangerTime"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="地点所在省:" :label-width="formLabelWidth">
						<el-select v-model='form.location' @change="changeCity();changeCity1();">
							<el-option :key="i" v-for="(item,i) in items" :value="item.name"></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="地点所在市:" :label-width="formLabelWidth">
						<el-select v-model='form.city' @change="changeCity1()">
							<el-option :key="i" v-for="(item,i) in cityArr" :value="item.name"></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="地点所在区县:" :label-width="formLabelWidth">
						<el-select v-model='form.county'>
							<el-option :key="i" v-for="(item,i) in cityArr1" :value="item.name"></el-option>
						</el-select>
					</el-form-item>
				</el-col>

				<el-col :span="24">
					<el-form-item label="出险详细地址:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.fullAddress"></el-input>
					</el-form-item>
				</el-col>

				<el-col :span="24">
					<el-form-item label="出险经过:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerPass"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="出险原因:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerCause"></el-input>
					</el-form-item>
				</el-col>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible1 = false">取 消</el-button>
				<el-button type="primary" v-if="flag3" @click="add()">添 加</el-button>
				<el-button type="primary" v-else @click="upd()">修 改</el-button>
			</div>
		</el-dialog>

		<el-dialog title="报案处理" :visible.sync="dialogFormVisible2">
			<el-form :model="form">
				<el-col :span="12">
					<el-form-item label="保单号:" :label-width="formLabelWidth">
						<el-input v-model="form.caseId" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>

				<el-col :span="12">
					<el-form-item label="报案人:" :label-width="formLabelWidth">
						<el-input v-model="form.informants" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出险司机:" :label-width="formLabelWidth">
						<el-input v-model="form.driver" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="司机电话:" :label-width="formLabelWidth">
						<el-input v-model="form.driverMob" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出险时间:" :label-width="formLabelWidth">
						<el-input v-model="form.dangerTime" autocomplete="off" disabled format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出险经过:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerPass" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="出险原因:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerCause" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="报案处理:" :label-width="formLabelWidth">
						<el-radio-group v-model="form.caseHandling">
							<el-radio :label="1">受理</el-radio>
							<el-radio :label="2">暂存</el-radio>
							<el-radio :label="3">注销</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible2 = false">取 消</el-button>
				<el-button type="primary" @click="chuli()">确定</el-button>
			</div>
		</el-dialog>


		<el-dialog title="案件审核" :visible.sync="dialogFormVisible3">
			<el-form :model="form">
				<el-col :span="12">
					<el-form-item label="保单号:" :label-width="formLabelWidth">
						<el-input v-model="form.caseId" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>

				<el-col :span="12">
					<el-form-item label="报案人:" :label-width="formLabelWidth">
						<el-input v-model="form.informants" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出险司机:" :label-width="formLabelWidth">
						<el-input v-model="form.driver" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="司机电话:" :label-width="formLabelWidth">
						<el-input v-model="form.driverMob" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="出险时间:" :label-width="formLabelWidth">
						<el-input v-model="form.dangerTime" autocomplete="off" disabled format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="出险经过:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerPass" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="出险原因:" :label-width="formLabelWidth">
						<el-input type="textarea" v-model="form.dangerCause" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="案件审核:" :label-width="formLabelWidth">
						<el-radio-group v-model="form.caseState">
							<el-radio :label="1">结案</el-radio>
							<el-radio :label="2">予以立案</el-radio>
							<el-radio :label="3">撤案</el-radio>
							<el-radio :label="4">注销</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible3 = false">取 消</el-button>
				<el-button type="primary" @click="shenhe()">确定</el-button>
			</div>
		</el-dialog>

		<el-dialog title="派工调度" :visible.sync="dialogFormVisible4">
			<el-form>
				<el-form-item label="查勘派工" :label-width="formLabelWidth">
					<el-select v-model="userId" @command="handleCommand" placeholder="请选择负责人">
						<el-option :key="user.userId" v-for="user in ulist" :label="user.username" :value="user.userId"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="工作结止时间:" :label-width="formLabelWidth">
					<el-date-picker type="date" placeholder="选择出厂日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="dispatchedWorkerEndTime"></el-date-picker>
				</el-form-item>
				<el-table ref="singleTable" :data="tableData" highlight-current-row @current-change="handleCurrentChange" style="width: 100%;height:325px">
					<el-table-column property="caseId" label="报案编号" width="150">
					</el-table-column>
					<el-table-column property="dangerTime" label="出险时间" width="120">
					</el-table-column>
					<el-table-column property="fullAddress" label="出险详细地点" width="120">
					</el-table-column>
					<el-table-column property="driverMob" label="出险电话" width="120">
					</el-table-column>
					<el-table-column label="报案处理" width="120">
						<td slot-scope="scope">{{zhProspectState(scope.row.caseHandling)}}</td>
					</el-table-column>
					<el-table-column label="操作">
						<template slot-scope="scope">
							<span><input type="checkbox" v-model="cases" :value="scope.row.caseId" /> </span>
						</template>
					</el-table-column>
				</el-table>
				<el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handleCurrentChange3">
				</el-pagination>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible4 = false">取 消</el-button>
				<el-button type="primary" @click="paigo()">确 定</el-button>
			</div>
		</el-dialog>
		<el-container>
			<el-header>
				<el-row :gutter="20">
					<el-col :span="3">
						<div class="grid-content bg-purple">车险理赔系统</div>
					</el-col>
					<el-col :span="2" :offset="14">
						<div class=" bg-purple font1">欢迎您</div>
					</el-col>
					<el-col :span="2">
						<div class=" bg-purple font1">{{uname}}</div>
					</el-col>
					<el-col :span="2">
						<div class=" bg-purple font1"><a class="hover1" @click="exit">安全退出</a></div>
					</el-col>
				</el-row>
			</el-header>
			<el-main>
				<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm form1">
					<el-form-item label="报案编号">
						<el-input v-model="ruleForm.caseId"></el-input>
					</el-form-item>
					<el-form-item label="被保人">
						<el-input v-model="ruleForm.recognizeeName"></el-input>
					</el-form-item>
					<el-form-item label="车牌号">
						<el-input v-model="ruleForm.plateNumber"></el-input>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
						<el-button @click="resetForm()">重置</el-button>
					</el-form-item>
				</el-form>
				<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
					<el-tab-pane label="保单列表" name="first">
						<el-tooltip content="添加出险信息" placement="top">
							<el-button type="primary" icon="el-icon-plus" @click="openInsert();"></el-button>
						</el-tooltip>
						<el-tooltip content="修改出险信息" placement="top">
							<el-button class="button" type="primary" icon="el-icon-edit" @click="openUpdate();"></el-button>
						</el-tooltip>
						<el-tooltip content="删除出险信息" placement="top">
							<el-button class="button" type="primary" @click="del()" icon="el-icon-delete"></el-button>
						</el-tooltip>
						<el-tooltip content="报案处理" placement="top">
							<el-button class="button" type="primary" @click="openChuli()" icon="el-icon-document-checked"></el-button>
						</el-tooltip>
						<el-tooltip content="案件审核" placement="top">
							<el-button class="button" type="primary" @click="openStatus()" icon="el-icon-search"></el-button>
						</el-tooltip>
						<el-tooltip content="派工调度" placement="top">
							<el-button class="button" type="primary" @click="openPaig()" icon="el-icon-user"></el-button>
						</el-tooltip>
						<el-table ref="singleTable" :data="clist" highlight-current-row @row-click="handleCurrentChange" style="width: 100%;height:325px">
							<el-table-column property="caseId" label="报案编号" width="150">
							</el-table-column>
							<el-table-column property="warrantyId" label="保单号" width="120">
							</el-table-column>
							<el-table-column property="recognizeeName" label="被保人" width="120">
							</el-table-column>
							<el-table-column property="informants" label="报案人" width="120">
							</el-table-column>
							<el-table-column property="dangerTime" label="出险时间" width="120">
							</el-table-column>
							<el-table-column property="fullAddress" label="出险详细地点" width="120">
							</el-table-column>
							<el-table-column property="driverMob" label="出险电话" width="120">
							</el-table-column>
							<el-table-column label="报案处理" width="120">
								<td slot-scope="scope">{{zhProspectState(scope.row.caseHandling)}}</td>
							</el-table-column>
							<el-table-column label="案件状态">
								<td slot-scope="scope">{{zhDisposeType(scope.row.caseState)}}</td>
							</el-table-column>
						</el-table>
					</el-tab-pane>
				</el-tabs>
				<el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handleCurrentChange2">
				</el-pagination>
			</el-main>
		</el-container>
	</div>
</template>

<script>
	export default {
		name: "dange",
		data() {
			return {
				uname: sessionStorage.getItem("userName"),
				ys: 12,
				tableData: [],
				ruleForm: {
					caseId: '',
					recognizeeName: '',
					plateNumber: ''
				},
				activeName: 'first',
				form: {
					//报案编号，例如case_2019010100001
					caseId: '',
					//保单编号，例如 bd_2019010100001
					warrantyId: '',
					//出险时间
					dangerTime: '',
					//车险地点所在省份
					location: '',
					//出险地点所在市
					city: '',
					//出险地点所在县/区
					county: '',
					//出险所在详细地址
					fullAddress: '',
					//出险经过
					dangerPass: '',
					//出险原因
					dangerCause: '',
					//报案人
					informants: '',
					//出险司机
					driver: '',
					//司机电话
					driverMob: '',
					//报案时间
					reportCaseTime: '',
					//立案时间
					filingTime: '',
					//结案时间
					closeCaseTime: '',
					//案件状态(1.结案 2.予以立案 3.撤案 4.注销)
					caseState: 1,
					//案件处理(1.受理 2.暂存 3.注销)
					caseHandling: 2,
					recognizeeName: '',
					plateNumber: ''
				},
				clist: [],
				dialogFormVisible1: false,
				dialogFormVisible2: false,
				dialogFormVisible3: false,
				dialogTableVisible5:false,
				formLabelWidth: '100px',
				dialogFormVisible4: false,
				flag1: false,
				flag2: false,
				flag3: true,
				items: [{
						name: '北京',
						sub: [{
								name: '北京市',
								sub: [{
									name: '北京市11'
								}, {
									name: '北京市12'
								}, {
									name: '北京市13'
								}]
							},
							{
								name: '北京市2',
								sub: [{
									name: '北京市21'
								}, {
									name: '北京市22'
								}, {
									name: '北京市23'
								}]
							},
						]
					},
					{
						name: '江西',
						sub: [{
								name: '南昌市',
								sub: [{
									name: '高新区'
								}, {
									name: '西湖区'
								}, {
									name: '瑶湖区'
								}]
							},
							{
								name: '赣州市',
								sub: [{
									name: '赣州市1'
								}, {
									name: '赣州市2'
								}, {
									name: '赣州市3'
								}]
							},
							{
								name: '抚州市',
								sub: [{
									name: '抚州市1'
								}, {
									name: '抚州市2'
								}, {
									name: '抚州市3'
								}]
							}
						]
					}
				],
				cityArr: [],
				cityArr1: [],
				total: 0,
				pageSize: 4,
				page: 1,
				currentRow: null,
				plist: [],
				clist2: [],
				cases: [],
				ulist: [],
				userId: '',
				glist: [],
				tjflag: true,
				dispatchedWorkerEndTime: '',
				baodan:null
			}
		},
		methods: {
			tjcx: function() {
				this.$axios.get("case/getCaseId?caseId=" + this.ruleForm.caseId + "&recognizeeName=" + this.ruleForm
						.recognizeeName +
						"&plateNumber=" + this.ruleForm.plateNumber + "&page=" + this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.clist = msg.data.list;
					});

			},
			submitForm() {
				this.tjcx();
				this.tjflag = false;
			},
			resetForm(ruleForm) {
				this.ruleForm = {
					caseId: '',
					recognizeeName: '',
					plateNumber: ''
				}
			},
			handleClick(tab, event) {
				console.log(tab, event);
			},
			handleCurrentChange(row) {

				this.currentRow = row;

			},
			handleCurrentChange1(val) {

				this.currentRow = val;
			},
			handleCommand() {
				this.fuz();
			},
			exit() {
				sessionStorage.clear();
				this.$router.push("/login");
			},
			handleCurrentChange2(val) {
				this.page = val;
				if (tjflag) {
					this.cxall();
				} else {
					this.tjcx();
				}
			},
			handleCurrentChange3(val) {
				this.$axios.get("case/getCaseChul?page=" + val)
					.then(msg => {
						this.total = msg.data.total;
						this.tableData = msg.data.list;
					});
			},
			handleCurrentChange5(val){
				this.baodan=val;
			},
			xuanz: function() {
				if (this.baodan != null) {
					this.form.warrantyId = this.baodan.warrantyId;
					this.form.recognizeeName = this.baodan.recognizeeName;
					this.form.plateNumber = this.baodan.plateNumber;
					this.dialogTableVisible5 = false;
				} else {
					this.$notify({
						title: '请选择需要被保人信息',
						type: 'warning'
					});
				}
			},
			changeCity: function() { //省切换

				var me = this;
				var item;
				me.items.forEach(function(ele) {
					if (ele.name === me.form.location) { //判断与prov是否相等，相等的表示被切换选中的省份
						item = ele;
					}
				})
				if (item) {
					this.cityArr = item.sub; //将选中的item的sub设置给cityArr 用于显示市
					this.form.city = item.sub[0].name; //默认选择第一个市
					this.cityArr1 = [];
					this.form.county = '';
				}
			},
			changeCity1: function() { //市切换
				var me = this;
				var item;
				me.cityArr.forEach(function(ele) {
					if (ele.name === me.form.city) { //判断与city是否相等，相等的表示被切换选中的市
						item = ele;
					}
				})
				if (item) {
					this.cityArr1 = item.sub; //将选中的item的sub设置给cityArr1 用于显示区
					this.form.county = item.sub[0].name; //默认选择第一个区
				}
			},
			zhProspectState(caseHandling) {
				if (caseHandling == 1) {
					return "受理";
				} else if (caseHandling == 2) {
					return "暂存";
				} else {
					return "注销";
				}
			},
			zhDisposeType(caseState) {
				if (caseState == 1) {
					return "结案";
				} else if (caseState == 2) {
					return "予以立案";
				} else if (caseState == 3) {
					return "撤案";
				} else {
					return "注销";
				}
			},
			cxall: function() {
				this.$axios.get("case/getCaseAll?page=" + this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.clist = msg.data.list;
					});
			},
			qk: function() {
				this.form = {
					//报案编号，例如case_2019010100001
					caseId: '',
					//保单编号，例如 bd_2019010100001
					warrantyId: '',
					//出险时间
					dangerTime: '',
					//车险地点所在省份
					location: '',
					//出险地点所在市
					city: '',
					//出险地点所在县/区
					county: '',
					//出险所在详细地址
					fullAddress: '',
					//出险经过
					dangerPass: '',
					//出险原因
					dangerCause: '',
					//报案人
					informants: '',
					//出险司机
					driver: '',
					//司机电话
					driverMob: '',
					//报案时间
					reportCaseTime: '',
					//立案时间
					filingTime: '',
					//结案时间
					closeCaseTime: '',
					//案件状态(1.结案 2.予以立案 3.撤案 4.注销)
					caseState: 2,
					//案件处理(1.受理 2.暂存 3.注销)
					caseHandling: 1,
					recognizeeName: '',
					plateNumber: ''
				}
			},
			fuzhi: function() {
				this.form = {
					//报案编号，例如case_2019010100001
					caseId: this.currentRow.caseId,
					//保单编号，例如 bd_2019010100001
					warrantyId: this.currentRow.warrantyId,
					//出险时间
					dangerTime: this.currentRow.dangerTime,
					//车险地点所在省份
					location: this.currentRow.location,
					//出险地点所在市
					city: this.currentRow.city,
					//出险地点所在县/区
					county: this.currentRow.county,
					//出险所在详细地址
					fullAddress: this.currentRow.fullAddress,
					//出险经过
					dangerPass: this.currentRow.dangerPass,
					//出险原因
					dangerCause: this.currentRow.dangerCause,
					//报案人
					informants: this.currentRow.informants,
					//出险司机
					driver: this.currentRow.driver,
					//司机电话
					driverMob: this.currentRow.driverMob,
					//报案时间
					reportCaseTime: this.currentRow.reportCaseTime,
					//立案时间
					filingTime: this.currentRow.filingTime,
					//结案时间
					closeCaseTime: this.currentRow.closeCaseTime,
					//案件状态(1.结案 2.予以立案 3.撤案 4.注销)
					caseState: this.currentRow.caseState,
					//案件处理(1.受理 2.暂存 3.注销)
					caseHandlin: this.currentRow.caseHandlin,
					recognizeeName: this.currentRow.recognizeeName,
					plateNumber: this.currentRow.plateNumber
				}
			},
			openInsert: function() {
				//http://localhost:5401/warranty/
				this.$axios.get("warranty/getWarrantyAll2")
					.then(msg => {
						this.plist = msg.data;
					});
				this.dialogFormVisible1 = true;
				this.ys = 24;
				this.flag3 = true;
				this.qk();
			},
			openUpdate: function() {
				if (this.currentRow != null) {
					this.ys = 24;
					this.fuzhi();
					this.flag3 = false;
					this.dialogFormVisible1 = true;
				} else {
					this.$notify({
						title: '请选择需要修改的保单信息',
						type: 'warning'
					});
				}
			},
			add: function() {
				this.$axios.post("case/insertCase", this.form)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								title: '添加成功',
								type: 'success'
							});
							this.qk();
							this.dialogFormVisible1 = false;
							this.cxall();
						}
					});
			},
			upd: function() {
				this.$axios.post("case/updateCase", this.form)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								title: '修改成功',
								type: 'success'
							});
							this.qk();
							this.dialogFormVisible1 = false;
							this.cxall();
						}
					});
			},
			del: function() {
				if (this.currentRow != null) {
					this.$confirm('此操作将删除报案号为' + this.currentRow.caseId + '的记录, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						this.$axios.get("case/updCaseHandling?caseHandling=3&caseState=0&caseId=" + this.currentRow.caseId)
							.then(msg => {
								if (msg.data > 0) {
									this.$notify({
										type: 'success',
										message: '删除成功!'
									});
									this.cxall();
								}
							})
					}).catch(() => {
						this.$notify({
							title: '取消删除',
							type: 'info'
						});
					});
				} else {
					this.$notify({
						title: '请选择需要修改的保单信息',
						type: 'warning'
					});
				}
			},
			openChuli: function() {
				if (this.currentRow != null) {
					this.fuzhi();
					this.dialogFormVisible2 = true;
				} else {
					this.$notify({
						title: '请选择需要处理的保单信息',
						type: 'warning'
					});
				}
			},
			chuli: function() {
				this.$axios.get("case/updCaseHandling?caseHandling=" + this.form.caseHandling + "&caseState=0&caseId=" +
						this.currentRow.caseId)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								type: 'success',
								message: '处理成功!'
							});
							this.cxall();
							this.dialogFormVisible2 = false;
						}
					})
			},
			openStatus: function() {
				if (this.currentRow != null) {
					this.fuzhi();
					this.dialogFormVisible3 = true;
				} else {
					this.$notify({
						title: '请选择需要审核的保单信息',
						type: 'warning'
					});
				}
			},
			shenhe: function() {
				this.$axios.get("case/updCaseHandling?caseHandling=0&caseState=" + this.form.caseState + "&caseId=" + this.currentRow
						.caseId)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								type: 'success',
								message: '处理成功!'
							});
							this.cxall();
							this.dialogFormVisible3 = false;
						}
					})
			},
			fuz: function() {
				this.$axios.get("case/getWorkerAll")
					.then(msg => {
						msg.data.forEach((row, i) => {
							if (row.userId == this.userId) {
								this.cases.push(row.caseId);
							}
						});
					})
			},
			openPaig: function() {
				this.$axios.get("getUserAll")
					.then(msg => {
						this.ulist = msg.data;
					})
				this.$axios.get("case/getCaseChul?page=" + this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.tableData = msg.data.list;
						this.fuz();
						
					})
					this.dialogFormVisible4 = true;
			},
			paigo: function() {
				var num = 0;
				this.cases.forEach((row, i) => {
					this.$axios.get("case/insertWorker?caseId=" + row + "&userId=" + this.userId + "&dispatchedWorkerEndTime=" +
							this.dispatchedWorkerEndTime)
						.then(msg => {
							if (msg.data > 0) {
								num++;
								if (num == this.cases.length) {
									this.$notify({
										type: 'success',
										message: '派工成功!'
									});
								}
								this.$axios.get("case/updCaseHandling?caseHandling=1&caseState=2&caseId=" + row)
									.then(msg => {

									})
							}

						})
				});
				this.dialogFormVisible4 = false;
			}
		},
		mounted() {
			this.cxall();
			this.tjflag = true;
		}
	}
</script>

<style scoped>
	.el-header {
		text-align: center;
		line-height: 60px;
	}


	.el-container {
		margin-left: 8px;
	}

	.el-header {
		padding: 0 0;
		border: #A8A8A8 1px solid;
		border-bottom: 0px;
		background-color: white;
	}

	.el-main {
		background-color: white;
		border: #A8A8A8 1px solid;
	}

	.font1 {
		color: #545C64;
		font-size: 14.2px;
	}

	.form1 {
		display: flex;
		border: #A8A8A8 1px solid;
		padding-top: 20px;
	}

	.el-tabs {
		margin-top: 9px;
	}

	.button {
		margin-left: 41px;
	}

	.hover1:hover {
		color: blue;
	}

	.item1 {
		width: 900px;
	}

	.el-col-11 {
		width: 150px;
	}

	.el-col-2[data-v-57aef37c] {
		text-align: center;
	}

	.el-dialog {
		width: 60%;
	}

	.line {
		width: 60px;
	}

	.col1 {
		width: 800px;
	}

	.el-col-10 {
		width: 20%;
	}
	.el-input {
		width: auto;
	}
</style>
